package com.supermap.gwfs.datashare.of.service;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;

/**
 * 格点逐时效累加判断
 * @author Administrator
 *
 */
@Service
public class GridAgingByPrescription {
	/**
	 * 雷阵雨
	 * @param SSM
	 * @return
	 */
	public JSONObject isLigth(float SSM){
		JSONObject result = new JSONObject();
		if (SSM == 4) {
			String judge = "雷阵雨";
			result.put("value", SSM);
			result.put("judge", judge);
		}
		
		return result;
	}
	/**
	 * 雷阵雨并伴有冰雹
	 * @param SSM
	 * @param HAIL
	 * @return
	 */

	public JSONObject isHAIL(float isLight, float isHAIL) {
		JSONObject result = new JSONObject();
		if (isLight == 4 && isHAIL==5) {
			String judge = "雷阵雨并伴有冰雹";
			result.put("value", isLight+"-"+isHAIL);
			result.put("judge", judge);
		}
		
		return result;
	}
	/**
	 * 雾
	 * @param FOG
	 * @return
	 */
	public JSONObject isFOG(float FOG) {
		JSONObject result = new JSONObject();
		if (FOG == 1 ){
			String judge = "轻雾";
			result.put("value", FOG);
			result.put("judge", judge);
		}else if (FOG == 2 ){
			String judge = "大雾";
			result.put("value", FOG);
			result.put("judge", judge);
		}else if (FOG == 3 ){
			String judge = "浓雾";
			result.put("value", FOG);
			result.put("judge", judge);
		}else if (FOG == 4 ){
			String judge = "强浓雾";
			result.put("value", FOG);
			result.put("judge", judge);
		}else if (FOG == 5 ){
			String judge = "特强浓雾";
			result.put("value", FOG);
			result.put("judge", judge);
		}else if (FOG == -1 ){
			String judge = "无雾";
			result.put("value", FOG);
			result.put("judge", judge);
		}
		
		return result;
	}
	/**
	 * 霾
	 * @param hZ
	 * @return
	 */
	public JSONObject isHZ(float hZ) {
		JSONObject result = new JSONObject();
		if (hZ == 1 ){
			String judge = "轻度霾";
			result.put("value", hZ);
			result.put("judge", judge);
		}else if (hZ == 2 ){
			String judge = "中度霾";
			result.put("value", hZ);
			result.put("judge", judge);
		}else if (hZ == 3 ){
			String judge = "重度霾";
			result.put("value", hZ);
			result.put("judge", judge);
		}else if (hZ == 4 ){
			String judge = "严重霾";
			result.put("value", hZ);
			result.put("judge", judge);
		}else if (hZ == -1 ){
			String judge = "无霾";
			result.put("value", hZ);
			result.put("judge", judge);
		}
		
		return result;
	
	
	}
	/**
	 * 冻雨
	 * @param freezingRain
	 * @param r55
	 * @return
	 */
	public JSONObject isfreezingRain(float freezingRain, float r55) {
		// TODO Auto-generated method stub
		JSONObject result = new JSONObject();
		if (freezingRain >= r55) {
			String judge = "冻雨";
			result.put("value", freezingRain);
			result.put("judge", judge);
		}
		return result;
	}
	
}
